package com.stm.bi.service;

import com.stm.bi.model.Chart;
import com.stm.bi.model.DatatablePage;
import com.stm.framework.dto.Response;
import com.stm.bi.dto.query.*;
import com.stm.bi.report.*;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;

/**
 * @Author zhouyuanpeng
 * @Desc
 * @Date 2025/9/5 10:05
 */
@Service
public class PolicyEvolveService {
    @Resource
    private PolicyEvolveDatatableQueryExe policyEvolveDatatableQueryExe;
    @Resource
    private PolicyEvolveTotalChartQueryExe policyEvolveTotalChartQueryExe;
    @Resource
    private PolicyEvolveDetailChartQueryExe processEvolveTotalChartQueryExe;


    public Response<DatatablePage> queryDatatable(PolicyEvolveDatatableQuery query) {
        return policyEvolveDatatableQueryExe.query(query);
    }

    public void export(HttpServletResponse response, PolicyEvolveDatatableQuery query) throws IOException {
        query.setExportable(Boolean.TRUE);
        policyEvolveDatatableQueryExe.export(response,query);
    }

    public Response<Chart<List<List<Object>>>> queryTotalChart(PolicyEvolveTotalChartQuery query) {
        return policyEvolveTotalChartQueryExe.query(query);
    }

    public Response<Chart<List<List<Object>>>> queryDetailChart(PolicyEvolveDetailChartQuery query) {
        return processEvolveTotalChartQueryExe.query(query);
    }
}
